-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #103 Remove width of checkbox from label #148
base: master
Are you sure you want to change the base?
Conversation
@bicknellr PTAL |
@@ -187,6 +187,7 @@ | |||
white-space: normal; | |||
line-height: normal; | |||
color: var(--paper-checkbox-label-color, var(--primary-text-color)); | |||
width: calc(100% - var(--paper-checkbox-size) - var(--paper-checkbox-label-spacing)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--paper-checkbox-size
-> --calculated-paper-checkbox-size
var(--paper-checkbox-label-spacing)
-> var(--paper-checkbox-label-spacing, 8px)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, slight hiccup here: this change prevents you from using 0
for --paper-checkbox-label-spacing
if you're trying to clear the styling so you can use an external label, which I suspect is a relatively common case. Particularly, you can't add lengths (which have units) and unitless values with calc()
. Also, you can't multiply two or more values having units, as the result would have units which aren't lengths; so multiplying by 1px
or something to get around this is out. :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @danbeam
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, after reading the CSS values spec, this appears to be a bug in the implementation of calc()
that happens to exist in all of Chrome / Firefox / Safari. (I haven't tried out Edge yet.) Filed as https://bugs.chromium.org/p/chromium/issues/detail?id=641556
The label was spilling over by the width of the checkbox and the spacing. This PR removes the spillage.